<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<div id="box1">盒子1</div>
<div class="box2">盒子2</div>
<div>盒子3</div>

<script>
    // get获取   Element元素   By通过    Id属性
    let elem1 = document.getElementById("box1")
    let elem2 = document.getElementsByClassName("box2")
    let elem3 = document.getElementsByTagName("div")
    let elem4 = document.querySelector("#box1")
    let elem5 = document.querySelectorAll("div")
    console.log(elem5[1])
</script>
</body>
</html>
